<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
  $_SESSION['MM_id_target']=NULL;
	$_SESSION['MM_aut_target']=NULL;
	$_SESSION['MM_nmb_target']=NULL;
	$_SESSION['MM_tp_programa']=NULL;
	$_SESSION['MM_id_candidato']=NULL;
	$_SESSION['MM_id_empresa']=NULL;
	
  $logoutGoTo = "../private/login.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "../private/login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
  $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}

$colname_rs_candidato = "-1";
if (isset($_SESSION['MM_id_target'])) {
  $colname_rs_candidato = $_SESSION['MM_id_target'];
}
require_once('../Connections/miportal.php'); 
mysql_query("SET NAMES 'utf8'");
mysql_select_db($database_miportal, $miportal);
$query_rs_candidato = sprintf("SELECT id_numRelacion, nb_nom_nombre1, nb_nom_nombre2, nb_nom_apaterno, nb_nom_amaterno, id_nom_fiscal, id_nmbNombre, tp_status_validacion,nb_nom_nombre FROM asignaciones WHERE id_cat_convocatoria=18 AND id_cat_ies=%s", $colname_rs_candidato);
$rs_candidato = mysql_query($query_rs_candidato, $miportal) or die(mysql_error());
$row_rs_candidato = mysql_fetch_assoc($rs_candidato);
$totalRows_rs_candidato = mysql_num_rows($rs_candidato);
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximun-scale=1">
<title>FUNDACIÓN EDUCACIÓN SUPERIOR-EMPRESA</title>
<!--Hoja de estilo principal-->
<link href="../css/styletd2.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="shortcut icon" href="stylesheet/img/devil-icon.png"> 
<link rel="stylesheet" type="text/css" href="../css/mos-style.css">
<link rel="stylesheet" type="text/css" href="../css/menu.css"><!--Pemanggilan gambar favicon-->
 <!--pemanggilan file css-->
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script language=""="JavaScript">
	function confirmar ( mensaje ) {
					return confirm( mensaje );
				}
        </script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
</head>
<body>
 <header>
    <div id="background"></div><!--BackGround Menu header-->
		<div class="img_header_logo"></div>
		<span class="img_header_logo"><a href="http://fese.org.mx"><img src="../images/fese/FESE_home_logo.png"  height="90" alt="FESE" align="bottom" /></a></span>
		<div class="img_header_logo"></div>
		<?php include_once('../include/riv_nav.php');?>
</header>
<center>
<div id="boxcontainer">
<div id="container">
  <p>&nbsp;</p>
  <h2>Candidatos convocatoria FESE Experimenta 2013</h2>
  <p>En esta sección, se podrá visualizar los candidatos registrados por los Responsables Operativos de Vinculación (ROV) del Programa FESE Experimenta.</p>
  <p>Una vez que los ROV hayan concluido el registro de candidatos, estos deberán ser validados y posteriormente se deberá imprimir el listado de los candidatos propuestos a este Programa.</p>
  <p>El listado deberá acompañar el oficio de propuesta emitido por el titular de la Institución o por el RIV, y enviarlo a las oficinas de la FESE junto con los expedientes.</p>
  <p><a href="../form/oficio_experimenta.php?oficio=<?php echo $_SESSION['MM_id_target']; ?> "  target="_blank">Descargar lista de candidatos</a> </p>
 <p>&nbsp;</p>
 <table width="100%" border="1" cellspacing="0" cellpadding="0" summary="Resumen de candidatos y sus asignaciones" style="margin-left:15px;">
    <tr>
      <th class="data" scope="col">NOMBRE</th>
      <th class="data" scope="col">EMPRESA</th>
      <th class="data" scope="col">PROGRAMA</th>
      <th class="data" scope="col">VALIDACIÓN</th>
    </tr>
    <?php if ($totalRows_rs_candidato>0){
		do { ?>
      <tr >
        <td class="data"><?php echo $row_rs_candidato['nb_nom_nombre1']." ".$row_rs_candidato['nb_nom_nombre2']." ".$row_rs_candidato['nb_nom_apaterno']." ".$row_rs_candidato['nb_nom_amaterno']; ?></td>
        <td class="data"><?php echo $row_rs_candidato['id_nom_fiscal']; ?> </td>
        <td class="data"><?php echo $row_rs_candidato['nb_nom_nombre']; ?> </td>
        <td class="data"><?php if($row_rs_candidato['tp_status_validacion']==0){echo "<a onClick=\"return confirmar('¿Esta seguro que desea validar al candidato: ".$row_rs_candidato['nb_nom_nombre1']." ".$row_rs_candidato['nb_nom_nombre1']." ".$row_rs_candidato['nb_nom_apaterno']." ".$row_rs_candidato['nb_nom_amaterno']."?')\" href='valida_candidato.php?rel=".base64_encode($row_rs_candidato['id_numRelacion'])."&redirect=EXPERIMENTA"."'>VALIDAR</a>";}else{echo "Validado";}; ?> </td>
      </tr>
      <?php } while ($row_rs_candidato = mysql_fetch_assoc($rs_candidato));
	}; //FIN IF?>
  </table>
  <p>&nbsp;</p>
<p>&nbsp;</p>
  <p>&nbsp;</p>
  <div id="dinamicContaint">
  
  </div><!--dinamicContaint-->
  <p>&nbsp;</p>
</div><!--Container-->
<?php include_once('../include/riv_rigth_container.php');?>


</div><!--Boxcontainer-->
</center>
  
  
</body>
</html>

